/*
* @Author: z.p
* @Project: Zdotp
* @Date: 2025年01月01日
* @Description: 具体的房间actor, 目前是世界聊天
*/

using Zdotp.Actor;
using Zdotp.Actor.Packet;

namespace MultiGateServer.Actors;

public class MultiRoomActor : ActorBase
{
    public class Player
    {
        public int PlayerId;
        public uint SessionId;
        public int GateActorId;

        public Player(int playerId, uint sessionId, int gateActorId)
        {
            PlayerId = playerId;
            SessionId = sessionId;
            GateActorId = gateActorId;
        }
    }

    public int GetNewPlayerId()
    {
        var res = 1;
        while (true)
        {
            var isFind = Players.Values.Any(player => player.PlayerId == res);
            if (!isFind) return res;
            ++res;
        }
    }
    
    public readonly Dictionary<uint, Player> Players = new();
    protected override void OnAwake()
    {
        
    }

    protected override void OnStart()
    {
        
    }

    protected override void OnUpdate(float deltaTime)
    {
        
    }

    protected override void OnDestroy()
    {
        
    }
}

public class RoomEnterMessage : MailObject;

public class RoomLeaveMessage : MailObject;

public class RoomChatMessage : MailObject
{
    public string Content;
}